import Mock from "mockjs";
import { Local } from "../utils";
class servicerEntity {
  fieldsSession = Local('servicerEntity-fields', Mock.mock({
    h5: {
      type: 'none',
    },
    weapp: {
      type: 'none',
    },
  }))
  get fields() {
    return this.fieldsSession.get();
  }
  set fields(obj: any) {
    this.fieldsSession.set(obj)
  }
  findAll() {
    return this.fields;
  }
  updateOne(field: string, val: any) {
    let obj = this.findAll();
    obj[field] = val;
    this.fields = obj;
    return this.fields[field];
  }
}

export default servicerEntity;